﻿@model Yeap.Models.FileBlockModel


@if (Model.Files.Count > 0)
{
    

<table class="BaseTable" cellspacing="0" cellpadding="0">
    <tbody>
        <tr>
            <th>Название файла</th>
            <th>От кого?</th>
            <th>Описание</th>
            <th>Размер</th>
            <th>Дата</th>
            <th>Скачать</th>
        </tr>
        @foreach (var workFile in Model.Files)
        {
            <tr>
            <td>@workFile.UploadedFile.FileName</td>
            <td>@workFile.UploadedFile.User.FullName</td>
            <td>@workFile.UploadedFile.FileDescription</td>
            <td>@workFile.UploadedFile.FileSize</td>
            <td>@workFile.UploadedFile.Time.ToString()</td>
            <td><a href="@Url.Content("~/Content/Upload/" + workFile.UploadedFile.FileName)">Скачать</a></td>
            </tr>
        }
    </tbody>
</table>   
    
}
else
{
    <text>
        Файлов не найдено.
    </text>
}

@using (Html.BeginForm("Upload", "Work", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    <input type="file" id="fileUpload" name="fileUpload" size="23" />
    @Html.TextBox("Description")
@Html.Hidden("workUploadId", Model.Work.Id)
<input type="submit" value="Upload File" />
}

<!--
    <% using (Html.BeginForm("Upload", "File", FormMethod.Post, new { enctype = "multipart/form-data" }))
       {%> <br />
       <label for="fileUpload">Файл:</label>
       <p><input type="file" id="fileUpload" name="fileUpload" size="23" />;</p><br />
       <label for="Description">Описание:</label>
       <%= Html.TextBox("Description") %><br />
       <label for="Parent">В категорию:</label>
       <%= Html.DropDownList("Parent",ViewData["Test"] as SelectList) %>
       <%= Html.Hidden("id",ViewData["id"].ToString()) %>
       <p><input type="submit" value="Upload File" /></p>
       <%
           
       }%>-->